/* -- INCLUDES ------------------------------------------------------------- */

/* -- DEFINES -------------------------------------------------------------- */
//#define EXEC_FORMAT			"php -r \"%s\""
//#define EXECUTABLE			"php"
#define EXECUTABLE			"./test"
#define DEFAULT_FUZZ_DIR	"."
#define DEFAULT_EXTENSION	".fuzz"
#define DEFAULT_FORMAT		"%s "
#define LOG_FILE_EXTENSION	".log"
#define GLOBAL_LOGS_FILE	"session.fuzz.log"
#define DELTA_ARRAY			10
#define DIR_ENTRY_FILE		0x8
#define WAIT_TIME			1	
#define STR_DATE_SIZE		20
//#define STR_DATE_FORMAT		"%T"
#define STR_DATE_FORMAT		"%02d:%02d:%02d:%03ld"
#define LINE_SIZE			4096
#define CORE_DUMP_NAME		"core"
#define ARGV_START			, "-r",
#define ARGV_END			,

/* -- TYPES ---------------------------------------------------------------- */
typedef enum { false = 0, true = 1 } bool_t;

typedef enum { NONE, INFO, WARNING, ERROR, SUCCESS, IMPORTANT } level_t;

typedef struct array_s
{
	unsigned int size;
	char ** elements;
} array_t, * array_p;

/* -- PROTOTYPES ----------------------------------------------------------- */
static void print_array( array_p array, char * text, char * format );
static void array_append( array_p array, char * value );
static void array_free( array_p array );
static void get_file_list( array_p list, char * path );
static void extend_core_limit();
static void launch_fuzz_thread( char * file );
static void logmsg( level_t type, FILE * f, char * msg, ... );
static void * fuzz_file( void * file );
static char * signal_name( int signal );

